package main

import (
	"fmt"
	"os"
)

// 打开文件写内容

func main() {
	fileObj, err := os.OpenFile("./1.txt", os.O_WRONLY|os.O_CREATE, 0644)
	if err != nil{
		fmt.Printf("open file failed,err:%v",err)
	}
	//fmt.Println(fileObj)

	// write
	fileObj.Write([]byte("a b c d e f g"))
	// writeString
	fileObj.WriteString("啊啊啊")
	fileObj.Close()
}


